function dy(){
setInterval(function(){
    var fontObj = document.createElement('div')
    fontObj.className = 'font'
    var min = 0
       var max = 25
       var index = Math.floor(  Math.random() * (max-min+1)+min )
       fontObj.innerText = 'QWERTYUIOPLKJHGFDSAZXCVBNM'.split('')[index]
   fontObj.style.position = 'absolute'
   var leftMin = 0 
   var leftMax = window.innerWidth || document.documentElement.clientWidth
   var left = Math.floor(  Math.random() * (leftMax-leftMin+1)+leftMin )
   var topMax = 0
   var topMin = window.innerHeight || document.documentElement.clientHeight
   var top =  Math.floor(  Math.random() * (topMax-topMin+1)+topMin )
   fontObj.style.left = left + 'px'
   fontObj.style.top = top + 'px'
   document.body.appendChild(fontObj)
       },1000)
       // 网页加事件监控键盘松开
   document.onkeyup = function(evt) {
       var e = evt || window.event
       // 直接从页面删除  并统计个数
       var fonts = document.querySelectorAll('div.font')
       fonts.forEach(function(item) {       
           if (item.innerText.toLowerCase() === e.key.toLowerCase())
           {
               // 1 删掉
               document.body.removeChild(item)
               // 2 统计+1
               var h1 = document.querySelector('h1')
               var num = parseInt(h1.innerText)
               h1.innerText = num+1
           }
       })
   }
}
dy()